﻿namespace BuildJavascriptDataModel
{
    using System;
    using System.Web.Mvc;

    public static class HtmlHelpers
    {
        public static string BuildJsPrototype(this HtmlHelper helper)
        {
            var modelType = helper.ViewData.Model.GetType();
            var d = BuildJavascriptDataModel.Build(modelType);
            return d;
        }
        public static string BuildJsPrototype(this HtmlHelper helper, string targetName)
        {
            var modelType = helper.ViewData.Model.GetType();
            var d = BuildJavascriptDataModel.Build(modelType, targetName);
            return d;
        }
        public static string BuildJsPrototype(this HtmlHelper helper, Type modelType)
        {
            var d = BuildJavascriptDataModel.Build(modelType);
            return d;
        }
        public static string BuildJsPrototype(this HtmlHelper helper, Type modelType,  string targetName)
        {
            var d = BuildJavascriptDataModel.Build(modelType, targetName);
            return d;
        }
    }
}